﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Indigo.Quibbler.Data
{
    // Need a list of NewsSection as data when I click on the Edition
    public class NewsSection
    {
        public NewsSection() { this.NewsArticles = new List<NewsArticle>(); }
        public string Category { get; set; }
        public string SectionName { get; set; }
        public string Description { get; set; }
        public string ImageSource { get; set; }
        public bool IsUpdated { get; set; }
        public List<NewsArticle> NewsArticles { get; set; }
    }
    public class NewsArticle
    {
        public NewsArticle() { this.Paragraphs = new List<ArticleParagraph>(); Images = new List<Image>(); Videos = new List<Video>(); }
        public string Category { get; set; }
        public string Id { get; set; }
        public string Headline { get; set; }
        public string SubHeadline { get; set; }
        public string PubDate { get; set; }
        public string Author { get; set; }
        public string Rating { get; set; }
        public List<string> Keywords { get; set; }
        public string ImageUrl
        {
            get
            {
                if (Images.Count > 0)
                    return Images[0].Url;
                else
                    return String.Empty;
            }
            set { }
        }
        public List<Image> Images { get; set; }
        public List<Video> Videos { get; set; }
        public string VideoUrl
        {
            get
            {
                if (Videos.Count > 0)
                    return Videos[0].Url;
                else
                    return String.Empty;
            }
            set { }
        }
        public List<ArticleParagraph> Paragraphs { get; set; }
        public long SyncTime { get; set; }
        public long ServerSyncTime { get; set; }
    }
    public class Image
    {
        public string Url { get; set; }
        public string Caption { get; set; }
    }
    public class Video
    {
        public string Url { get; set; }
        public string Caption { get; set; }
    }
    public class ArticleParagraph
    {
        public string Text { get; set; }
        public ParagraphStyle Style { get; set; }
    }

    public enum ParagraphStyle
    {
        None,
        Bold,
        Italic        
    }

    #region Data Structures as per UI requirements
    //Library Data Item
    public class LibraryDataItem
    {
        public string Publication { get; set; }
        public string Date { get; set; }
        public string Image { get; set; }
        public string File { get; set; }
    }
    //Publication wise
    public class PublicationwiseDataItem
    {
        public string Publication { get; set; }
        public List<LibraryDataItem> LibraryObject { get; set; }
    }
    //DateWise
    public class DatewiseDataItem
    {
        public string Date { get; set; }
        public List<LibraryDataItem> LibraryObject { get; set; }
    }
    #endregion
}